<?php use Application\Model\vn3dUtil;?>
<style>
.vn3d-cart-img img {
	width: 212px !important;
	height: auto !important;
}

.vn3d-cart-product {
	margin-top: 5px;
	margin-bottom: 5px;
	border-bottom: 1px dotted;
}
</style>
<script type="text/javascript">
function reloadPage(){
	window.location.reload();
}
$(document).ready(function(){

	$("#vn3d-clear-cart").click(function(){

bootbox.confirm("Are you sure you want to clear cart?",function(result){
if(result){
	location.href="/store/reset-cart";
}

});
		});
});
</script>
<ol class="breadcrumb">
	<li><a href="/store">Home</a></li>
	<li class="active">Shopping cart</li>
</ol>
<hr>
<div class="panel panel-primary">
	<div class="panel-heading" style="height: 40px;">
		<span class="panel-title pull-left">Product</span> <span
			class="panel-title pull-right">Unit price</span>
	</div>
	<div>
    <?php

    if (count($cart) > 0) {
        foreach ($cart as $key => $value) {

            ?>
      <div
			class="vn3d-cart-product col-md-12 pull-left <?php echo $key;?>">
			<span class="btn-close pull-left" product="<?php echo $key;?>"
				title="delete" style="margin: 6px; height: 5px; width: 5px;">×</span>


			<div class="vn3d-cart-img col-md-4">
				<a
					href="/store/product/<?php echo $value["id"];?>/<?php echo vn3dUtil::convertUrlSeo($value["name"]);?>">
					<img style="-webkit-user-select: none"
					alt="<?php echo $value["name"];?>"
					title="<?php echo $value["name"];?>"
					src="/banner/<?php echo $value["id"];?>/<?php echo $value["id"];?>.png">
				</a>
			</div>
			<div class="vn3d-desc col-md-7 pull-right">
				<a
					href="/store/product/<?php echo $value["id"];?>/<?php echo vn3dUtil::convertUrlSeo($value["name"]);?>"><?php echo $value["name"];?></a>

				<span class="pull-right">$<?php echo $value["price"];?>.00</span>
			</div>

		</div>

    <?php
        }
        ?>
        <div class="col-md-12"
			style="background-color: gainsboro; height: 50px">
			<div class="col-md-3 pull-right">
				<span class="pull-right">$<?php echo $totalPrice['sub-total'];?></span>
			</div>
			<div class="col-md-4 pull-right">
				<span class="pull-left">Subtotal</span>
			</div>

		</div>
		<div class="col-md-12"
			style="background-color: gainsboro; height: 50px"">

			<div class="col-md-3 pull-right">
				<h3 class="pull-right">$<?php echo $totalPrice['sub-total'];?></h3>
			</div>
			<div class="col-md-4 pull-right">
				<h3 class="pull-left">Subtotal</h3>
			</div>

		</div>
		<div
			style="height: 10px; border-bottom: 1px solid gainsboro; margin-bottom: 3px"
			class="col-md-12"></div>
		<div class="col-md-12" style="height: 50px"">

			<a class="btn btn-default pull-left" role="button" href="/">BACK TO
				STORE</a>
			<?php if (count($cart) > 0) {?>
			<button class="btn btn-default" type="button" id="vn3d-clear-cart">CLEAR CART</button> <a
				class="pull-right"
				href="/store/checkout"><img src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" align="left" style="margin-right:7px;"></a>
            <?php }?>
		</div>
        <?php
    } else {
        ?>
        <div style="background-color: gainsboro; height: 100px">
			<center style="padding-top: 50px">
				<span >Cart is empty</span>
			</center>
		</div>
    <?php }?>
	</div>
</div>
